package de.iritgo.skillfull.entity.command;

import de.iritgo.skillfull.component.visitor.PositionVisitor;
import de.iritgo.skillfull.entity.Command;
import de.iritgo.skillfull.entity.Entity;

public class PauseCommand implements Command 
{
	private Entity entity;
	private boolean done;
	private int pause;
	private int elapsed;
	
	public PauseCommand (Entity entity, int pause)
	{
		this.entity = entity;
		this.pause = pause;
		done = false;
		elapsed = 0;
	}

	public String getName ()
	{
		return "Pause"; 
	}

	@Override
	public boolean canPerform () 
	{
		return true;
	}

	@Override
	public void perform (int delta) 
	{
		elapsed += delta;
		if (elapsed >= pause)
			done = true;
	}
	
	@Override
	public void stop() 
	{
		done = true;
	}

	public Command getUndoCommand () 
	{
		return null;
	}

	@Override
	public boolean isDone () 
	{
		return done;
	}
}
